#### TABLE 1 ####
library(tidyverse)
library(xtable)

setwd("data/analysis/")

# import results from heterogeneity tests
d <- read.csv("heterogeneity_stats.csv")

table(d$d.ATE.sig, d$d.ATE.NRFU.sig) |> 
      xtable() |>
      print(include.rownames = FALSE) |>
      write_file(file = "../../results/Table_1_counts.tex")

prop.table(table(d$d.ATE.sig, d$d.ATE.NRFU.sig)) |> 
      xtable() |>
      print(include.rownames = FALSE) |>
      write_file(file = "../../results/Table_1_proportions.tex")
